﻿using Define;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tools.EventObjectMoudle;

namespace LogicCenter.Logic
{
    public class GameClient : Player
    {
        public string GetName()
        {
            return strName;
        }

        public int GetRoleID()
        {
            return nRoleID;
        }

        DateTime tLast_HeartBeat = DateTime.Now;
        /// <summary>
        /// 模拟玩家心跳
        /// </summary>
        public void HeartBeat()
        {
            DateTime tNow = DateTime.Now;
            if ((tNow - tLast_HeartBeat).TotalSeconds < 2)
                return;
            tLast_HeartBeat = tNow;

            GlobalEventSource.getInstance().fireEvent((int)EventTypes.PlayerOnline, this);
        }
    }
}
